#include<iostream>
#include<cmath>
#include"ProblemA.h"
using namespace std;

double Function1(double x){
    return 1/x - tan(x);
}

double Function2(double x){
    return 1/x - pow(2 , x);
}

double Function3(double x){
    return pow(2 , -x) + exp(x) + 2 * cos(x) - 6;
}

double Function4(double x){
    return (x*x*x + 4*x*x + 3*x + 5) / (2*x*x*x - 9*x*x + 18*x - 2);
}

int main(){

    double eps = 10e-7;

    Bisection zero1(0 , M_PI/2 , eps , Function1);
    cout << "Function1:";
    CheckPrint(zero1.solve(), Function1);

    Bisection zero2(0 , 1 , eps , Function2);
    cout << "Function2:";
    CheckPrint(zero2.solve(), Function2);

    Bisection zero3(1 , 3 , eps , Function3);
    cout << "Function3:";
    CheckPrint(zero3.solve(), Function3);

    Bisection zero4(0 , 4 , eps , Function4);
    cout << "Function4:";
    CheckPrint(zero4.solve(), Function4);

    return 0;
}